package com.kuaimacode.kframework.mybatis.mapper.agent;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kuaimacode.kframework.mybatis.models.agent.SysAgentMapRolePermission;

import java.util.List;

/**
 * 用户角色map信息
 */
public interface SysAgentMapRolePermissionMapper extends BaseMapper<SysAgentMapRolePermission> {

	/**
	 * 给角色分配权限
	 *
	 * @param roleId        角色ID
	 * @param permissionIds 权限ids
	 */
	void grant(@Param("roleId") String roleId, @Param("permissionIds") String[] permissionIds);

	/**
	 * 根据角色id查找其所有的权限id
	 * @param roleId
	 * @return
	 */
	List<String> findAllPermissionIds(@Param("roleId")String roleId);
}
